package freespiritsocial.io.user.viewmodel

import freespiritsocial.io.user.data.model.bean.UserInfo
import freespiritsocial.io.user.network.apiService
import freespiritsocial.io.user.viewmodel.delegates.IPeopleApi
import freespiritsocial.io.user.viewmodel.delegates.PeopleDelegate
import me.hgj.jetpackmvvm.base.viewmodel.BaseViewModel
import me.hgj.jetpackmvvm.callback.databind.StringObservableField
import me.hgj.jetpackmvvm.ext.request

/**
 * @description 粉丝/关注 列表
 * @author csw
 * @date 2021-10-18
 */
class FollowsListViewModel: BaseViewModel(),IPeopleApi by PeopleDelegate() {
    val searchText = StringObservableField()
    fun getFans(action: (List<UserInfo>) -> Unit) {
        request({
            apiService.getMyFanList()
        },{
            action(it)
        })
    }
}